from django.conf.urls.defaults import *
from django.conf import settings

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    url(r'^admin/', include(admin.site.urls)),
    
    (r'^$',                                         'media.music.views.music'),
    (r'^music/$',                                   'media.music.views.music'),
    (r'^home/$',                                    'media.music.views.music'),
    (r'^music_admin/$',                             'media.music.views.music_admin'),
    (r'^test/$',                                    'media.music.views.catalog_drive_music'),
    (r'^login/$',                                   'media.views.user_login' ),
    (r'^logout/$',                                  'media.views.user_logout' ),
    (r'^register/$',                                'media.views.register_user' ),
    (r'^is_admin/$',                                'media.views.is_admin' ),
    (r'^check_session/$',                            'media.views.check_session' ),
#    
    (r'^add_music/rebuild/$',                       'media.music.views.rebuild_music_db'),
    (r'^add_music/add/$',                           'media.music.views.add_to_music_db'),
    (r'^add_music/upload/$',                        'media.music.views.upload_music'),
      
    (r'^album_info/(?P<album_id>\d+)/$',            'media.music.views.album_info'),
    (r'^album_show/(?P<album_id>\d+)/$',            'media.music.views.album'),
    (r'^album_delete/(?P<album_id>\d+)/$',          'media.music.views.delete_album'),
    (r'^album_get_art/(?P<album_id>\d+)/$',         'media.music.views.get_single_album_art'),
    (r'^album_get_single_art/(?P<album_id>\d+)/$',  'media.music.views.get_single_album_art'),
    (r'^album_share/(?P<album_id>\d+)/$',           'media.music.views.share_album'),
    (r'^download_album/(?P<album_id>\d+)/$',        'media.music.views.download_album'),
    (r'^albums_by_artist/(?P<artist_id>\d+)/$',     'media.music.views.albums_by_artist'),
    (r'^albums_by_genre/(?P<genre_id>\d+)/$',       'media.music.views.albums_by_genre'),
    (r'^albums_by_year/(?P<year_id>\d+)/$',         'media.music.views.albums_by_year'),
    (r'^song/(?P<song_id>\d+)/$',                   'media.music.views.get_song'),
    
    (r'^rating/(?P<song_id>\d+)/(?P<rating>\d+)/$', 'media.music.views.set_rating'),
    (r'^get_profile_song_columns/$',                'media.music.views.get_profile_song_columns'),
    (r'^set_profile_song_columns/$',                'media.music.views.set_profile_song_columns'),
    (r'^set_theme/$',                               'media.music.views.set_theme'),
    (r'^save_playlist/$',                               'media.music.views.save_playlist'),
       
    (r'^rename_nzbs/$',                             'media.music.views.rename_nzbs' ),
    (r'^filter_nzbs/$',                             'media.music.views.filter_nzbs' ), 
    (r'^copy_favs/$',                               'media.music.views.copy_favs' ), 
    (r'^update_album_art/$',                        'media.music.views.update_album_art' ),  
    
    (r'^search_music_artists/$',                    'media.music.views.search_music_artists'),
    (r'^search_music_albums/$',                     'media.music.views.search_music_albums'),
    (r'^search_music_songs/$',                      'media.music.views.search_music_songs'),
    (r'^artists/0/$',                               'media.music.views.artists', {'letter': '0'}),
    (r'^artists/A/$',                               'media.music.views.artists', {'letter': 'A'}),
    (r'^artists/B/$',                               'media.music.views.artists', {'letter': 'B'}),
    (r'^artists/C/$',                               'media.music.views.artists', {'letter': 'C'}),
    (r'^artists/D/$',                               'media.music.views.artists', {'letter': 'D'}),
    (r'^artists/E/$',                               'media.music.views.artists', {'letter': 'E'}),
    (r'^artists/F/$',                               'media.music.views.artists', {'letter': 'F'}),
    (r'^artists/G/$',                               'media.music.views.artists', {'letter': 'G'}),
    (r'^artists/H/$',                               'media.music.views.artists', {'letter': 'H'}),
    (r'^artists/I/$',                               'media.music.views.artists', {'letter': 'I'}),
    (r'^artists/J/$',                               'media.music.views.artists', {'letter': 'J'}),
    (r'^artists/K/$',                               'media.music.views.artists', {'letter': 'K'}),
    (r'^artists/L/$',                               'media.music.views.artists', {'letter': 'L'}),
    (r'^artists/M/$',                               'media.music.views.artists', {'letter': 'M'}),
    (r'^artists/N/$',                               'media.music.views.artists', {'letter': 'N'}),
    (r'^artists/O/$',                               'media.music.views.artists', {'letter': 'O'}),
    (r'^artists/P/$',                               'media.music.views.artists', {'letter': 'P'}),
    (r'^artists/Q/$',                               'media.music.views.artists', {'letter': 'Q'}),
    (r'^artists/R/$',                               'media.music.views.artists', {'letter': 'R'}),
    (r'^artists/S/$',                               'media.music.views.artists', {'letter': 'S'}),
    (r'^artists/T/$',                               'media.music.views.artists', {'letter': 'T'}),
    (r'^artists/U/$',                               'media.music.views.artists', {'letter': 'U'}),
    (r'^artists/V/$',                               'media.music.views.artists', {'letter': 'V'}),
    (r'^artists/VA/$',                              'media.music.views.artists', {'letter': 'VA'}),
    (r'^artists/OST/$',                             'media.music.views.artists', {'letter': 'OST'}),
    (r'^artists/W/$',                               'media.music.views.artists', {'letter': 'W'}),
    (r'^artists/X/$',                               'media.music.views.artists', {'letter': 'X'}),
    (r'^artists/Y/$',                               'media.music.views.artists', {'letter': 'Y'}),
    (r'^artists/Z/$',                               'media.music.views.artists', {'letter': 'Z'}),
    (r'^artists/all/$',                             'media.music.views.artists', {'letter': 'all'}),
    
    (r'^albums/0/$',                           'media.music.views.albums', {'letter': '0'}),
    (r'^albums/A/$',                           'media.music.views.albums', {'letter': 'A'}),
    (r'^albums/B/$',                           'media.music.views.albums', {'letter': 'B'}),
    (r'^albums/C/$',                           'media.music.views.albums', {'letter': 'C'}),
    (r'^albums/D/$',                           'media.music.views.albums', {'letter': 'D'}),
    (r'^albums/E/$',                           'media.music.views.albums', {'letter': 'E'}),
    (r'^albums/F/$',                           'media.music.views.albums', {'letter': 'F'}),
    (r'^albums/G/$',                           'media.music.views.albums', {'letter': 'G'}),
    (r'^albums/H/$',                           'media.music.views.albums', {'letter': 'H'}),
    (r'^albums/I/$',                           'media.music.views.albums', {'letter': 'I'}),
    (r'^albums/J/$',                           'media.music.views.albums', {'letter': 'J'}),
    (r'^albums/K/$',                           'media.music.views.albums', {'letter': 'K'}),
    (r'^albums/L/$',                           'media.music.views.albums', {'letter': 'L'}),
    (r'^albums/M/$',                           'media.music.views.albums', {'letter': 'M'}),
    (r'^albums/N/$',                           'media.music.views.albums', {'letter': 'N'}),
    (r'^albums/O/$',                           'media.music.views.albums', {'letter': 'O'}),
    (r'^albums/P/$',                           'media.music.views.albums', {'letter': 'P'}),
    (r'^albums/Q/$',                           'media.music.views.albums', {'letter': 'Q'}),
    (r'^albums/R/$',                           'media.music.views.albums', {'letter': 'R'}),
    (r'^albums/S/$',                           'media.music.views.albums', {'letter': 'S'}),
    (r'^albums/T/$',                           'media.music.views.albums', {'letter': 'T'}),
    (r'^albums/U/$',                           'media.music.views.albums', {'letter': 'U'}),
    (r'^albums/V/$',                           'media.music.views.albums', {'letter': 'V'}),
    (r'^albums/W/$',                           'media.music.views.albums', {'letter': 'W'}),
    (r'^albums/X/$',                           'media.music.views.albums', {'letter': 'X'}),
    (r'^albums/Y/$',                           'media.music.views.albums', {'letter': 'Y'}),
    (r'^albums/Z/$',                           'media.music.views.albums', {'letter': 'Z'}),
    (r'^albums/all/$',                           'media.music.views.albums', {'letter': 'all'}),
    

    (r'^rebuild/0/$',                           'media.music.views.rebuild', {'letter': '0'}),
    (r'^rebuild/A/$',                           'media.music.views.rebuild', {'letter': 'A'}),
    (r'^rebuild/B/$',                           'media.music.views.rebuild', {'letter': 'B'}),
    (r'^rebuild/C/$',                           'media.music.views.rebuild', {'letter': 'C'}),
    (r'^rebuild/D/$',                           'media.music.views.rebuild', {'letter': 'D'}),
    (r'^rebuild/E/$',                           'media.music.views.rebuild', {'letter': 'E'}),
    (r'^rebuild/F/$',                           'media.music.views.rebuild', {'letter': 'F'}),
    (r'^rebuild/G/$',                           'media.music.views.rebuild', {'letter': 'G'}),
    (r'^rebuild/H/$',                           'media.music.views.rebuild', {'letter': 'H'}),
    (r'^rebuild/I/$',                           'media.music.views.rebuild', {'letter': 'I'}),
    (r'^rebuild/J/$',                           'media.music.views.rebuild', {'letter': 'J'}),
    (r'^rebuild/K/$',                           'media.music.views.rebuild', {'letter': 'K'}),
    (r'^rebuild/L/$',                           'media.music.views.rebuild', {'letter': 'L'}),
    (r'^rebuild/M/$',                           'media.music.views.rebuild', {'letter': 'M'}),
    (r'^rebuild/N/$',                           'media.music.views.rebuild', {'letter': 'N'}),
    (r'^rebuild/O/$',                           'media.music.views.rebuild', {'letter': 'O'}),
    (r'^rebuild/P/$',                           'media.music.views.rebuild', {'letter': 'P'}),
    (r'^rebuild/Q/$',                           'media.music.views.rebuild', {'letter': 'Q'}),
    (r'^rebuild/R/$',                           'media.music.views.rebuild', {'letter': 'R'}),
    (r'^rebuild/S/$',                           'media.music.views.rebuild', {'letter': 'S'}),
    (r'^rebuild/T/$',                           'media.music.views.rebuild', {'letter': 'T'}),
    (r'^rebuild/U/$',                           'media.music.views.rebuild', {'letter': 'U'}),
    (r'^rebuild/V/$',                           'media.music.views.rebuild', {'letter': 'V'}),
    (r'^rebuild/W/$',                           'media.music.views.rebuild', {'letter': 'W'}),
    (r'^rebuild/X/$',                           'media.music.views.rebuild', {'letter': 'X'}),
    (r'^rebuild/Y/$',                           'media.music.views.rebuild', {'letter': 'Y'}),
    (r'^rebuild/Z/$',                           'media.music.views.rebuild', {'letter': 'Z'}),
    (r'^rebuild/all/$',                         'media.music.views.rebuild', {'letter': 'all'}),    

    
    (r'^handle_tv_drive/$',                     'media.tv_shows.views.handle_tv_drive'),
    (r'^view_tv_shows/$',                       'media.tv_shows.views.view_tv_shows'),
    (r'^view_tv_show/(?P<show_id>\d+)/$',       'media.tv_shows.views.view_tv_show'),
    (r'^search_tv_shows/$',                     'media.tv_shows.views.search_tv_shows'),
    (r'^add_episodes/(?P<show_id>\d+)/$',       'media.tv_shows.views.add_episodes'),
    (r'^fix_eps/$',                             'media.tv_shows.views.fix_eps'),
    (r'^delete_episode/$',                      'media.tv_shows.views.delete_episode'),

    # Movies
    (r'^handle_movies_drive/$',                 'media.movies.views.handle_movies_drive'),
    (r'^view_movies/$',                         'media.movies.views.view_movies'),
    (r'^search_movies/$',                       'media.movies.views.search_movies'),
)

if settings.DEBUG:
    urlpatterns += patterns( '',
        url( r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT} ),
        url( r'^W/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.DRIVE_W} ),
        url( r'^X/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.DRIVE_X} ),
        url( r'^Y/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.DRIVE_Y} ),
        url( r'^Z/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.DRIVE_Z} ),
    )